import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import { Circle, Toast, Search, Tabbar, TabbarItem, Dialog, Icon, Swipe, SwipeItem, Uploader, Grid, GridItem, ShareSheet, Button, Divider,Lazyload } from 'vant'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'

import App from './App.vue'
import router from './router'

// 导入 Vant
import 'vant/lib/index.css' // 引入 Vant 样式

const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

// 注册 Element Plus
app.use(ElementPlus, {
  locale: zhCn,
})

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(pinia)
app.use(router)
app.use(Circle)
app.use(Toast)
app.use(Search)
app.use(Tabbar)
app.use(TabbarItem)
app.use(Dialog)
app.use(Icon)
app.use(ShareSheet)
app.use(Lazyload)
app.use(Swipe)
app.use(SwipeItem)
app.use(Button)
app.use(Divider)
app.use(Uploader)
app.use(Grid)
app.use(GridItem)
app.mount('#app');


